<#assign menu="price">
<#assign submenu="update_price">
<#include "../../manage/head.ftl">
<!--main content start-->
<style type="text/css">

</style>
<section id="main-content">
    <section class="wrapper">
        <!-- page start-->
        <form id="update_price_form" class="form-horizontal" action="${BASE_PATH}/manage/price/edit.json"
              autocomplete="off" method="post"
              enctype="multipart/form-data">
            <fieldset>
                <div class="row">
                    <input type="hidden" name="priceId" value="${price.id}">
                    <input type="hidden" name="goodsId" value="${price.goodsId}">

                    <div class="col-lg-12">
                        <section class="panel">
                            <header class="panel-heading">
                                修改价格
                            </header>
                            <div class="panel-body">


                                <div class="form-group">
                                    <label class="col-sm-2 col-sm-2 control-label">商品名</label>

                                    <div class="col-sm-10">
                                        <input type="text" style="font-size:15px;width: 300px;" class="form-control"
                                               name="goodsName"   value="${price.goodsName}" readonly>
                                        </input>
                                    </div>
                                </div>

                                <div class="form-group">
                                    <label class="col-sm-2 col-sm-2 control-label">尺寸</label>

                                    <div class="col-sm-10">
                                        <input type="text" style="font-size:15px;width: 300px;" class="form-control"
                                               name="size"   value="${price.size}">
                                        </input>
                                    </div>
                                </div>

                                <div class="form-group">
                                    <label class="col-sm-2 col-sm-2 control-label">价格</label>

                                    <div class="col-sm-10">
                                        <input type="text" style="font-size:15px;width: 300px;" class="form-control"
                                               name="price"   value="${price.price}">
                                        </input>
                                    </div>
                                </div>

                                <div class="form-group">
                                    <div class="col-lg-offset-2 col-lg-10">
                                        <button class="btn btn-shadow btn-primary" type="submit">更新</button>
                                    </div>
                                </div>
                            </div>

                        </section>

                    </div>
                </div>
            </fieldset>
        </form>
        <!-- page end-->
    </section>
</section>

<script type="text/javascript">

    $(function () {
        $('#update_price_form').ajaxForm({
            dataType: 'json',
            success: function (data) {
                if (data.result) {
                    bootbox.alert("保存成功，将刷新页面", function () {
                        window.location.reload();
                    });

                } else {
                    showErrors($('#update_price_form'), data.errors);
                }
            }
        });
    });

</script>
<#include "../../manage/foot.ftl">
